﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SD.IDAL;
using System.Data.SqlClient;
using System.Data;
using SD.Entities;

namespace SD.DAL
{
    public class ServiceDAO:BaseDAO, IServiceDAO
    {
        #region IServiceDAO Members

        public List<SD.Entities.Service> GetAll(Boolean includeInactive)
        {
            try
            {
                SqlCommand comm = CreateCommand();
                comm.CommandText = "ServiceGetAll";
                comm.Parameters.AddWithValue("@includeInactive", includeInactive);

                DataTable dt = ExecuteSelectCommand(comm);
                List<Service> list = new List<Service>();
                Service s = null;
                foreach (DataRow row in dt.Rows)
                {
                    s = new Service();
                    s.ServiceId = row["ServiceId"].ToString();
                    s.Name = row["Name"].ToString();
                    list.Add(s);
                }
                return list;
            }
            catch (SqlException ex)
            {

                throw ex;
            }
        }

        public SD.Entities.Service GetById(string serviceId)
        {
            throw new NotImplementedException();
        }

        public bool Insert(SD.Entities.Service service)
        {
            throw new NotImplementedException();
        }

        public bool Update(SD.Entities.Service service)
        {
            throw new NotImplementedException();
        }

        public bool Delete(string serviceId)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
